/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('paiabtest', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CheckLayerRequest {
  paramNames?: string(name='ParamNames'),
}

model CheckLayerResponseBody = {
  checkResults?: [ 
    {
      experimentId?: string(name='ExperimentId'),
      experimentName?: string(name='ExperimentName'),
      paramName?: string(name='ParamName'),
    }
  ](name='CheckResults'),
  requestId?: string(name='RequestId'),
}

model CheckLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckLayerResponseBody(name='body'),
}

/**
 * @summary 对层上的参数进行校验
 *
 * @param request CheckLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckLayerResponse
 */
async function checkLayerWithOptions(LayerId: string, request: CheckLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckLayerResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.paramNames)) {
    query['ParamNames'] = request.paramNames;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckLayer',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}/action/check`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 对层上的参数进行校验
 *
 * @param request CheckLayerRequest
 * @return CheckLayerResponse
 */
async function checkLayer(LayerId: string, request: CheckLayerRequest): CheckLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return checkLayerWithOptions(LayerId, request, headers, runtime);
}

model CreateCrowdRequest {
  description?: string(name='Description'),
  label?: string(name='Label'),
  name?: string(name='Name', description='This parameter is required.'),
  users?: string(name='Users', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateCrowdResponseBody = {
  crowdId?: string(name='CrowdId'),
  requestId?: string(name='RequestId'),
}

model CreateCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCrowdResponseBody(name='body'),
}

/**
 * @summary 创建人群
 *
 * @param request CreateCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCrowdResponse
 */
async function createCrowdWithOptions(request: CreateCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCrowdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.label)) {
    body['Label'] = request.label;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCrowd',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建人群
 *
 * @param request CreateCrowdRequest
 * @return CreateCrowdResponse
 */
async function createCrowd(request: CreateCrowdRequest): CreateCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCrowdWithOptions(request, headers, runtime);
}

model CreateDomainRequest {
  bucketType?: string(name='BucketType', description='This parameter is required.'),
  condition?: string(name='Condition'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  flow?: long(name='Flow'),
  layerId?: string(name='LayerId', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  projectId?: string(name='ProjectId', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateDomainResponseBody = {
  domainId?: string(name='DomainId'),
  requestId?: string(name='RequestId'),
}

model CreateDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDomainResponseBody(name='body'),
}

/**
 * @summary 创建实验域
 *
 * @param request CreateDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDomainResponse
 */
async function createDomainWithOptions(request: CreateDomainRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketType)) {
    body['BucketType'] = request.bucketType;
  }
  if (!Util.isUnset(request.condition)) {
    body['Condition'] = request.condition;
  }
  if (!Util.isUnset(request.crowdIds)) {
    body['CrowdIds'] = request.crowdIds;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.flow)) {
    body['Flow'] = request.flow;
  }
  if (!Util.isUnset(request.layerId)) {
    body['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDomain',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/domains`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建实验域
 *
 * @param request CreateDomainRequest
 * @return CreateDomainResponse
 */
async function createDomain(request: CreateDomainRequest): CreateDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDomainWithOptions(request, headers, runtime);
}

model CreateExperimentRequest {
  bucketType?: string(name='BucketType', description='This parameter is required.'),
  condition?: string(name='Condition'),
  coreMetricId?: string(name='CoreMetricId', description='This parameter is required.'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  endTime?: string(name='EndTime', description='This parameter is required.'),
  flow?: int32(name='Flow'),
  focusMetricIds?: string(name='FocusMetricIds', description='This parameter is required.'),
  layerId?: string(name='LayerId', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  startTime?: string(name='StartTime', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateExperimentResponseBody = {
  experimentId?: string(name='ExperimentId'),
  requestId?: string(name='RequestId'),
}

model CreateExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentResponseBody(name='body'),
}

/**
 * @summary 创建实验
 *
 * @param request CreateExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentResponse
 */
async function createExperimentWithOptions(request: CreateExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketType)) {
    body['BucketType'] = request.bucketType;
  }
  if (!Util.isUnset(request.condition)) {
    body['Condition'] = request.condition;
  }
  if (!Util.isUnset(request.coreMetricId)) {
    body['CoreMetricId'] = request.coreMetricId;
  }
  if (!Util.isUnset(request.crowdIds)) {
    body['CrowdIds'] = request.crowdIds;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.flow)) {
    body['Flow'] = request.flow;
  }
  if (!Util.isUnset(request.focusMetricIds)) {
    body['FocusMetricIds'] = request.focusMetricIds;
  }
  if (!Util.isUnset(request.layerId)) {
    body['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperiment',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建实验
 *
 * @param request CreateExperimentRequest
 * @return CreateExperimentResponse
 */
async function createExperiment(request: CreateExperimentRequest): CreateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentWithOptions(request, headers, runtime);
}

model CreateExperimentVersionRequest {
  config?: string(name='Config'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  experimentId?: string(name='ExperimentId', description='This parameter is required.'),
  flow?: int32(name='Flow'),
  name?: string(name='Name', description='This parameter is required.'),
  type?: string(name='Type', description='This parameter is required.'),
}

model CreateExperimentVersionResponseBody = {
  experimentVersionId?: string(name='ExperimentVersionId'),
  requestId?: string(name='RequestId'),
}

model CreateExperimentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentVersionResponseBody(name='body'),
}

/**
 * @summary 创建实验版本
 *
 * @param request CreateExperimentVersionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentVersionResponse
 */
async function createExperimentVersionWithOptions(request: CreateExperimentVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.crowdIds)) {
    body['CrowdIds'] = request.crowdIds;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.experimentId)) {
    body['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.flow)) {
    body['Flow'] = request.flow;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperimentVersion',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentversions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建实验版本
 *
 * @param request CreateExperimentVersionRequest
 * @return CreateExperimentVersionResponse
 */
async function createExperimentVersion(request: CreateExperimentVersionRequest): CreateExperimentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentVersionWithOptions(request, headers, runtime);
}

model CreateFeatureRequest {
  regionId?: string(name='RegionId'),
  name?: string(name='Name'),
  status?: string(name='Status'),
}

model CreateFeatureResponseBody = {
  featureId?: string(name='FeatureId'),
  requestId?: string(name='RequestId'),
}

model CreateFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFeatureResponseBody(name='body'),
}

/**
 * @summary 创建Feature
 *
 * @param request CreateFeatureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFeatureResponse
 */
async function createFeatureWithOptions(request: CreateFeatureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFeatureResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFeature',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/features`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建Feature
 *
 * @param request CreateFeatureRequest
 * @return CreateFeatureResponse
 */
async function createFeature(request: CreateFeatureRequest): CreateFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFeatureWithOptions(request, headers, runtime);
}

model CreateLayerRequest {
  description?: string(name='Description'),
  domainId?: string(name='DomainId'),
  name?: string(name='Name', description='This parameter is required.'),
  projectId?: string(name='ProjectId', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateLayerResponseBody = {
  layerId?: string(name='LayerId'),
  requestId?: string(name='RequestId'),
}

model CreateLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLayerResponseBody(name='body'),
}

/**
 * @summary 创建实验层
 *
 * @param request CreateLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLayerResponse
 */
async function createLayerWithOptions(request: CreateLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateLayerResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.domainId)) {
    body['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateLayer',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建实验层
 *
 * @param request CreateLayerRequest
 * @return CreateLayerResponse
 */
async function createLayer(request: CreateLayerRequest): CreateLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createLayerWithOptions(request, headers, runtime);
}

model CreateMetricRequest {
  definition?: string(name='Definition', description='This parameter is required.'),
  description?: string(name='Description'),
  metricGroupId?: string(name='MetricGroupId', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  sourceTableMetaId?: string(name='SourceTableMetaId', description='This parameter is required.'),
}

model CreateMetricResponseBody = {
  metricId?: string(name='MetricId'),
  requestId?: string(name='RequestId'),
}

model CreateMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMetricResponseBody(name='body'),
}

/**
 * @summary 创建指标
 *
 * @param request CreateMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMetricResponse
 */
async function createMetricWithOptions(request: CreateMetricRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateMetricResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.definition)) {
    body['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.metricGroupId)) {
    body['MetricGroupId'] = request.metricGroupId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.sourceTableMetaId)) {
    body['SourceTableMetaId'] = request.sourceTableMetaId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMetric',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metrics`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建指标
 *
 * @param request CreateMetricRequest
 * @return CreateMetricResponse
 */
async function createMetric(request: CreateMetricRequest): CreateMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createMetricWithOptions(request, headers, runtime);
}

model CreateMetricGroupRequest {
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateMetricGroupResponseBody = {
  metricGroupId?: string(name='MetricGroupId'),
  requestId?: string(name='RequestId'),
}

model CreateMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMetricGroupResponseBody(name='body'),
}

/**
 * @summary 创建指标组
 *
 * @param request CreateMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMetricGroupResponse
 */
async function createMetricGroupWithOptions(request: CreateMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateMetricGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateMetricGroup',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metricgroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建指标组
 *
 * @param request CreateMetricGroupRequest
 * @return CreateMetricGroupResponse
 */
async function createMetricGroup(request: CreateMetricGroupRequest): CreateMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createMetricGroupWithOptions(request, headers, runtime);
}

model CreateProjectRequest {
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateProjectResponseBody = {
  projectId?: string(name='ProjectId'),
  requestId?: string(name='RequestId'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary 创建实验项目
 *
 * @param request CreateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(request: CreateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProject',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建实验项目
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectWithOptions(request, headers, runtime);
}

model CreateTableMetaRequest {
  datasourceInfo?: string(name='DatasourceInfo', description='This parameter is required.'),
  datasourceType?: string(name='DatasourceType', description='This parameter is required.'),
  description?: string(name='Description'),
  fields?: [ 
    {
      meaning?: string(name='Meaning', description='This parameter is required.'),
      name?: string(name='Name', description='This parameter is required.'),
      type?: string(name='Type'),
    }
  ](name='Fields', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  tableName?: string(name='TableName', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model CreateTableMetaResponseBody = {
  requestId?: string(name='RequestId'),
  tableMetaId?: string(name='TableMetaId'),
}

model CreateTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTableMetaResponseBody(name='body'),
}

/**
 * @summary 创建数据表
 *
 * @param request CreateTableMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTableMetaResponse
 */
async function createTableMetaWithOptions(request: CreateTableMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTableMetaResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.datasourceInfo)) {
    body['DatasourceInfo'] = request.datasourceInfo;
  }
  if (!Util.isUnset(request.datasourceType)) {
    body['DatasourceType'] = request.datasourceType;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTableMeta',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建数据表
 *
 * @param request CreateTableMetaRequest
 * @return CreateTableMetaResponse
 */
async function createTableMeta(request: CreateTableMetaRequest): CreateTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTableMetaWithOptions(request, headers, runtime);
}

model DeleteCrowdResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCrowdResponseBody(name='body'),
}

/**
 * @summary 删除指定的人群
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCrowdResponse
 */
async function deleteCrowdWithOptions(CrowdId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteCrowdResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteCrowd',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定的人群
 *
 * @return DeleteCrowdResponse
 */
async function deleteCrowd(CrowdId: string): DeleteCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteCrowdWithOptions(CrowdId, headers, runtime);
}

model DeleteDomainResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDomainResponseBody(name='body'),
}

/**
 * @summary 删除指定的实验域
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDomainResponse
 */
async function deleteDomainWithOptions(DomainId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteDomainResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomain',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/domains/${OpenApiUtil.getEncodeParam(DomainId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定的实验域
 *
 * @return DeleteDomainResponse
 */
async function deleteDomain(DomainId: string): DeleteDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteDomainWithOptions(DomainId, headers, runtime);
}

model DeleteExperimentResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentResponseBody(name='body'),
}

/**
 * @summary 删除指定的实验
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentResponse
 */
async function deleteExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperiment',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定的实验
 *
 * @return DeleteExperimentResponse
 */
async function deleteExperiment(ExperimentId: string): DeleteExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteExperimentWithOptions(ExperimentId, headers, runtime);
}

model DeleteExperimentVersionResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteExperimentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentVersionResponseBody(name='body'),
}

/**
 * @summary 删除指定的实验版本
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentVersionResponse
 */
async function deleteExperimentVersionWithOptions(ExperimentVersionId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteExperimentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperimentVersion',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentversions/${OpenApiUtil.getEncodeParam(ExperimentVersionId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定的实验版本
 *
 * @return DeleteExperimentVersionResponse
 */
async function deleteExperimentVersion(ExperimentVersionId: string): DeleteExperimentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteExperimentVersionWithOptions(ExperimentVersionId, headers, runtime);
}

model DeleteFeatureResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFeatureResponseBody(name='body'),
}

/**
 * @summary 删除Feature
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFeatureResponse
 */
async function deleteFeatureWithOptions(FeatureId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteFeatureResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteFeature',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/features/${OpenApiUtil.getEncodeParam(FeatureId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除Feature
 *
 * @return DeleteFeatureResponse
 */
async function deleteFeature(FeatureId: string): DeleteFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteFeatureWithOptions(FeatureId, headers, runtime);
}

model DeleteLayerResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLayerResponseBody(name='body'),
}

/**
 * @summary 删除指定的实验层
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLayerResponse
 */
async function deleteLayerWithOptions(LayerId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteLayerResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteLayer',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定的实验层
 *
 * @return DeleteLayerResponse
 */
async function deleteLayer(LayerId: string): DeleteLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteLayerWithOptions(LayerId, headers, runtime);
}

model DeleteMetricResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricResponseBody(name='body'),
}

/**
 * @summary 删除指定指标
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricResponse
 */
async function deleteMetricWithOptions(MetricId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteMetricResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetric',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metrics/${OpenApiUtil.getEncodeParam(MetricId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定指标
 *
 * @return DeleteMetricResponse
 */
async function deleteMetric(MetricId: string): DeleteMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteMetricWithOptions(MetricId, headers, runtime);
}

model DeleteMetricGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricGroupResponseBody(name='body'),
}

/**
 * @summary 删除指定的指标组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricGroupResponse
 */
async function deleteMetricGroupWithOptions(MetricGroupId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteMetricGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetricGroup',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metricgroups/${OpenApiUtil.getEncodeParam(MetricGroupId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除指定的指标组
 *
 * @return DeleteMetricGroupResponse
 */
async function deleteMetricGroup(MetricGroupId: string): DeleteMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteMetricGroupWithOptions(MetricGroupId, headers, runtime);
}

model DeleteProjectResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProjectResponseBody(name='body'),
}

/**
 * @summary 删除实验项目
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProjectResponse
 */
async function deleteProjectWithOptions(ProjectId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProjectResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProject',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${OpenApiUtil.getEncodeParam(ProjectId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除实验项目
 *
 * @return DeleteProjectResponse
 */
async function deleteProject(ProjectId: string): DeleteProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProjectWithOptions(ProjectId, headers, runtime);
}

model DeleteTableMetaResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTableMetaResponseBody(name='body'),
}

/**
 * @summary 删除数据表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTableMetaResponse
 */
async function deleteTableMetaWithOptions(TableMetaId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteTableMetaResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteTableMeta',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas/${OpenApiUtil.getEncodeParam(TableMetaId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除数据表
 *
 * @return DeleteTableMetaResponse
 */
async function deleteTableMeta(TableMetaId: string): DeleteTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteTableMetaWithOptions(TableMetaId, headers, runtime);
}

model GetCrowdResponseBody = {
  crowdId?: string(name='CrowdId'),
  description?: string(name='Description'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  label?: string(name='Label'),
  name?: string(name='Name'),
  quantity?: string(name='Quantity'),
  requestId?: string(name='RequestId'),
  users?: string(name='Users'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCrowdResponseBody(name='body'),
}

/**
 * @summary 获取指定人群详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCrowdResponse
 */
async function getCrowdWithOptions(CrowdId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetCrowdResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetCrowd',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定人群详情
 *
 * @return GetCrowdResponse
 */
async function getCrowd(CrowdId: string): GetCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getCrowdWithOptions(CrowdId, headers, runtime);
}

model GetDomainRequest {
  projectId?: string(name='ProjectId'),
}

model GetDomainResponseBody = {
  bucketType?: string(name='BucketType'),
  buckets?: string(name='Buckets'),
  condition?: string(name='Condition'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  domainId?: string(name='DomainId'),
  flow?: long(name='Flow'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  isDefaultDomain?: boolean(name='IsDefaultDomain'),
  layerId?: string(name='LayerId'),
  layerName?: string(name='LayerName'),
  name?: string(name='Name'),
  projectId?: string(name='ProjectId'),
  projectName?: string(name='ProjectName'),
  requestId?: string(name='RequestId'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDomainResponseBody(name='body'),
}

/**
 * @summary 获取指定实验域详情
 *
 * @param request GetDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDomainResponse
 */
async function getDomainWithOptions(DomainId: string, request: GetDomainRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetDomainResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDomain',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/domains/${OpenApiUtil.getEncodeParam(DomainId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定实验域详情
 *
 * @param request GetDomainRequest
 * @return GetDomainResponse
 */
async function getDomain(DomainId: string, request: GetDomainRequest): GetDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDomainWithOptions(DomainId, request, headers, runtime);
}

model GetExperimentResponseBody = {
  bucketType?: string(name='BucketType'),
  buckets?: string(name='Buckets'),
  condition?: string(name='Condition'),
  coreMetricId?: string(name='CoreMetricId'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  domainName?: string(name='DomainName'),
  endTime?: string(name='EndTime'),
  experimentId?: string(name='ExperimentId'),
  flow?: int32(name='Flow'),
  focusMetricIds?: string(name='FocusMetricIds'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  layerId?: string(name='LayerId'),
  layerName?: string(name='LayerName'),
  name?: string(name='Name'),
  owner?: string(name='Owner'),
  projectName?: string(name='ProjectName'),
  requestId?: string(name='RequestId'),
  startTime?: string(name='StartTime'),
  status?: string(name='Status'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentResponseBody(name='body'),
}

/**
 * @summary 获取指定实验的详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentResponse
 */
async function getExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetExperiment',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定实验的详情
 *
 * @return GetExperimentResponse
 */
async function getExperiment(ExperimentId: string): GetExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentWithOptions(ExperimentId, headers, runtime);
}

model GetExperimentVersionResponseBody = {
  buckets?: string(name='Buckets'),
  config?: string(name='Config'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  experimentId?: string(name='ExperimentId'),
  experimentVersionId?: string(name='ExperimentVersionId'),
  flow?: int32(name='Flow'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  type?: string(name='Type'),
}

model GetExperimentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentVersionResponseBody(name='body'),
}

/**
 * @summary 获取指定实验版本的详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentVersionResponse
 */
async function getExperimentVersionWithOptions(ExperimentVersionId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentVersion',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentversions/${OpenApiUtil.getEncodeParam(ExperimentVersionId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定实验版本的详情
 *
 * @return GetExperimentVersionResponse
 */
async function getExperimentVersion(ExperimentVersionId: string): GetExperimentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentVersionWithOptions(ExperimentVersionId, headers, runtime);
}

model GetFeatureResponseBody = {
  condition?: string(name='Condition'),
  config?: string(name='Config'),
  domainId?: string(name='DomainId'),
  domainName?: string(name='DomainName'),
  experimentId?: string(name='ExperimentId'),
  experimentName?: string(name='ExperimentName'),
  experimentOwner?: string(name='ExperimentOwner'),
  experimentVersionId?: string(name='ExperimentVersionId'),
  experimentVersionName?: string(name='ExperimentVersionName'),
  featureId?: string(name='FeatureId'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  name?: string(name='Name'),
  projectId?: string(name='ProjectId'),
  projectName?: string(name='ProjectName'),
  releaseTime?: string(name='ReleaseTime'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFeatureResponseBody(name='body'),
}

/**
 * @summary 获取Feature详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFeatureResponse
 */
async function getFeatureWithOptions(FeatureId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFeatureResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFeature',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/features/${OpenApiUtil.getEncodeParam(FeatureId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取Feature详情
 *
 * @return GetFeatureResponse
 */
async function getFeature(FeatureId: string): GetFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFeatureWithOptions(FeatureId, headers, runtime);
}

model GetLayerResponseBody = {
  description?: string(name='Description'),
  domainId?: string(name='DomainId'),
  domainName?: string(name='DomainName'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  isDefaultLayer?: boolean(name='IsDefaultLayer'),
  layerId?: string(name='LayerId'),
  name?: string(name='Name'),
  projectId?: string(name='ProjectId'),
  projectName?: string(name='ProjectName'),
  requestId?: string(name='RequestId'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLayerResponseBody(name='body'),
}

/**
 * @summary 获取指定的实验层详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLayerResponse
 */
async function getLayerWithOptions(LayerId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetLayerResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetLayer',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定的实验层详情
 *
 * @return GetLayerResponse
 */
async function getLayer(LayerId: string): GetLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getLayerWithOptions(LayerId, headers, runtime);
}

model GetMetricResponseBody = {
  definition?: string(name='Definition'),
  description?: string(name='Description'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  metricGroupId?: string(name='MetricGroupId'),
  metricId?: string(name='MetricId'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  sourceTableMetaId?: string(name='SourceTableMetaId'),
  sourceTableMetaName?: string(name='SourceTableMetaName'),
}

model GetMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMetricResponseBody(name='body'),
}

/**
 * @summary 获取指标详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMetricResponse
 */
async function getMetricWithOptions(MetricId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetMetricResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetMetric',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metrics/${OpenApiUtil.getEncodeParam(MetricId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指标详情
 *
 * @return GetMetricResponse
 */
async function getMetric(MetricId: string): GetMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getMetricWithOptions(MetricId, headers, runtime);
}

model GetMetricGroupResponseBody = {
  description?: string(name='Description'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  metricGroupId?: string(name='MetricGroupId'),
  metrics?: [ 
    {
      definition?: string(name='Definition'),
      description?: string(name='Description'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      metricId?: string(name='MetricId'),
      name?: string(name='Name'),
      relatedExperimentNumber?: long(name='RelatedExperimentNumber'),
      sourceTableMetaId?: string(name='SourceTableMetaId'),
    }
  ](name='Metrics'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMetricGroupResponseBody(name='body'),
}

/**
 * @summary 获取指标组的详细信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMetricGroupResponse
 */
async function getMetricGroupWithOptions(MetricGroupId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetMetricGroupResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetMetricGroup',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metricgroups/${OpenApiUtil.getEncodeParam(MetricGroupId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指标组的详细信息
 *
 * @return GetMetricGroupResponse
 */
async function getMetricGroup(MetricGroupId: string): GetMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getMetricGroupWithOptions(MetricGroupId, headers, runtime);
}

model GetProjectResponseBody = {
  defaultDomainId?: string(name='DefaultDomainId'),
  defaultLayerId?: string(name='DefaultLayerId'),
  description?: string(name='Description'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  name?: string(name='Name'),
  projectId?: string(name='ProjectId'),
  requestId?: string(name='RequestId'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectResponseBody(name='body'),
}

/**
 * @summary 获取指定的实验项目
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectResponse
 */
async function getProjectWithOptions(ProjectId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProjectResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetProject',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${OpenApiUtil.getEncodeParam(ProjectId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定的实验项目
 *
 * @return GetProjectResponse
 */
async function getProject(ProjectId: string): GetProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectWithOptions(ProjectId, headers, runtime);
}

model GetTableMetaResponseBody = {
  datasourceInfo?: string(name='DatasourceInfo'),
  datasourceType?: string(name='DatasourceType'),
  description?: string(name='Description'),
  fields?: [ 
    {
      meaning?: string(name='Meaning'),
      name?: string(name='Name'),
      type?: string(name='Type'),
    }
  ](name='Fields'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  tableMetaId?: string(name='TableMetaId'),
  tableName?: string(name='TableName'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableMetaResponseBody(name='body'),
}

/**
 * @summary 获取数据表详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableMetaResponse
 */
async function getTableMetaWithOptions(TableMetaId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetTableMetaResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetTableMeta',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas/${OpenApiUtil.getEncodeParam(TableMetaId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取数据表详情
 *
 * @return GetTableMetaResponse
 */
async function getTableMeta(TableMetaId: string): GetTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTableMetaWithOptions(TableMetaId, headers, runtime);
}

model ListCrowdsRequest {
  all?: boolean(name='All'),
  crowdId?: string(name='CrowdId'),
  crowdName?: string(name='CrowdName'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  regionId?: string(name='RegionId'),
  sortBy?: string(name='SortBy'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListCrowdsResponseBody = {
  crowds?: [ 
    {
      aliyunId?: string(name='AliyunId'),
      crowdId?: string(name='CrowdId'),
      description?: string(name='Description'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifyTime?: string(name='GmtModifyTime'),
      label?: string(name='Label'),
      name?: string(name='Name'),
      quantity?: string(name='Quantity'),
      users?: string(name='Users'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='Crowds'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListCrowdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCrowdsResponseBody(name='body'),
}

/**
 * @summary 获取人群列表
 *
 * @param request ListCrowdsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCrowdsResponse
 */
async function listCrowdsWithOptions(request: ListCrowdsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListCrowdsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.crowdId)) {
    query['CrowdId'] = request.crowdId;
  }
  if (!Util.isUnset(request.crowdName)) {
    query['CrowdName'] = request.crowdName;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCrowds',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取人群列表
 *
 * @param request ListCrowdsRequest
 * @return ListCrowdsResponse
 */
async function listCrowds(request: ListCrowdsRequest): ListCrowdsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listCrowdsWithOptions(request, headers, runtime);
}

model ListDomainsRequest {
  all?: boolean(name='All'),
  domainId?: string(name='DomainId'),
  domainName?: string(name='DomainName'),
  layerId?: string(name='LayerId'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  projectId?: string(name='ProjectId'),
  regionId?: string(name='RegionId'),
  sortBy?: string(name='SortBy'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListDomainsResponseBody = {
  domains?: [ 
    {
      bucketType?: string(name='BucketType'),
      buckets?: string(name='Buckets'),
      condition?: string(name='Condition'),
      crowdIds?: string(name='CrowdIds'),
      debugUsers?: string(name='DebugUsers'),
      description?: string(name='Description'),
      domainId?: string(name='DomainId'),
      flow?: long(name='Flow'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      isDefaultDomain?: boolean(name='IsDefaultDomain'),
      layerId?: string(name='LayerId'),
      layerName?: string(name='LayerName'),
      name?: string(name='Name'),
      projectId?: string(name='ProjectId'),
      projectName?: string(name='ProjectName'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='Domains'),
  requestId?: string(name='RequestId'),
  totalCount?: string(name='TotalCount'),
}

model ListDomainsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDomainsResponseBody(name='body'),
}

/**
 * @summary 获取实验域列表
 *
 * @param request ListDomainsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDomainsResponse
 */
async function listDomainsWithOptions(request: ListDomainsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDomainsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.domainId)) {
    query['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.layerId)) {
    query['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDomains',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/domains`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验域列表
 *
 * @param request ListDomainsRequest
 * @return ListDomainsResponse
 */
async function listDomains(request: ListDomainsRequest): ListDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDomainsWithOptions(request, headers, runtime);
}

model ListExperimentVersionsRequest {
  all?: boolean(name='All'),
  experimentId?: string(name='ExperimentId'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  sortBy?: string(name='SortBy'),
}

model ListExperimentVersionsResponseBody = {
  experimentVersions?: [ 
    {
      buckets?: string(name='Buckets'),
      config?: string(name='Config'),
      crowdIds?: string(name='CrowdIds'),
      debugUsers?: string(name='DebugUsers'),
      description?: string(name='Description'),
      experimentId?: string(name='ExperimentId'),
      experimentVersionId?: string(name='ExperimentVersionId'),
      flow?: int32(name='Flow'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      name?: string(name='Name'),
      type?: string(name='Type'),
    }
  ](name='ExperimentVersions'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListExperimentVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentVersionsResponseBody(name='body'),
}

/**
 * @summary 获取实验版本列表
 *
 * @param request ListExperimentVersionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentVersionsResponse
 */
async function listExperimentVersionsWithOptions(request: ListExperimentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListExperimentVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperimentVersions',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentversions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验版本列表
 *
 * @param request ListExperimentVersionsRequest
 * @return ListExperimentVersionsResponse
 */
async function listExperimentVersions(request: ListExperimentVersionsRequest): ListExperimentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listExperimentVersionsWithOptions(request, headers, runtime);
}

model ListExperimentsRequest {
  all?: boolean(name='All'),
  experimentId?: string(name='ExperimentId'),
  experimentName?: string(name='ExperimentName'),
  layerId?: string(name='LayerId'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  projectId?: string(name='ProjectId'),
  sortBy?: string(name='SortBy'),
  status?: string(name='Status'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListExperimentsResponseBody = {
  experiments?: [ 
    {
      bucketType?: string(name='BucketType'),
      buckets?: string(name='Buckets'),
      condition?: string(name='Condition'),
      coreMetricId?: string(name='CoreMetricId'),
      crowdIds?: string(name='CrowdIds'),
      debugUsers?: string(name='DebugUsers'),
      description?: string(name='Description'),
      domainName?: string(name='DomainName'),
      endTime?: string(name='EndTime'),
      experimentId?: string(name='ExperimentId'),
      flow?: int32(name='Flow'),
      focusMetricIds?: string(name='FocusMetricIds'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      layerId?: string(name='LayerId'),
      layerName?: string(name='LayerName'),
      name?: string(name='Name'),
      owner?: string(name='Owner'),
      projectName?: string(name='ProjectName'),
      startTime?: string(name='StartTime'),
      status?: string(name='Status'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='Experiments'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListExperimentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentsResponseBody(name='body'),
}

/**
 * @summary 获取实验列表
 *
 * @param request ListExperimentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentsResponse
 */
async function listExperimentsWithOptions(request: ListExperimentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListExperimentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.experimentName)) {
    query['ExperimentName'] = request.experimentName;
  }
  if (!Util.isUnset(request.layerId)) {
    query['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperiments',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验列表
 *
 * @param request ListExperimentsRequest
 * @return ListExperimentsResponse
 */
async function listExperiments(request: ListExperimentsRequest): ListExperimentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listExperimentsWithOptions(request, headers, runtime);
}

model ListFeaturesRequest {
  all?: boolean(name='All'),
  domainId?: string(name='DomainId'),
  featureId?: string(name='FeatureId'),
  featureName?: string(name='FeatureName'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  regionId?: string(name='RegionId'),
  sortBy?: string(name='SortBy'),
  status?: string(name='Status'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListFeaturesResponseBody = {
  features?: [ 
    {
      config?: string(name='Config'),
      domainId?: string(name='DomainId'),
      domainName?: string(name='DomainName'),
      experimentId?: string(name='ExperimentId'),
      experimentName?: string(name='ExperimentName'),
      experimentOwner?: string(name='ExperimentOwner'),
      experimentVersionId?: string(name='ExperimentVersionId'),
      experimentVersionName?: string(name='ExperimentVersionName'),
      featureId?: string(name='FeatureId'),
      filter?: string(name='Filter'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      name?: string(name='Name'),
      projectId?: string(name='ProjectId'),
      projectName?: string(name='ProjectName'),
      releaseTime?: string(name='ReleaseTime'),
      status?: string(name='Status'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='Features'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListFeaturesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeaturesResponseBody(name='body'),
}

/**
 * @summary 获取Faeture列表
 *
 * @param request ListFeaturesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeaturesResponse
 */
async function listFeaturesWithOptions(request: ListFeaturesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeaturesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.domainId)) {
    query['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.featureId)) {
    query['FeatureId'] = request.featureId;
  }
  if (!Util.isUnset(request.featureName)) {
    query['FeatureName'] = request.featureName;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatures',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/features`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取Faeture列表
 *
 * @param request ListFeaturesRequest
 * @return ListFeaturesResponse
 */
async function listFeatures(request: ListFeaturesRequest): ListFeaturesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeaturesWithOptions(request, headers, runtime);
}

model ListLayersRequest {
  all?: boolean(name='All'),
  domainId?: string(name='DomainId'),
  layerId?: string(name='LayerId'),
  layerName?: string(name='LayerName'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  projectId?: string(name='ProjectId'),
  sortBy?: string(name='SortBy'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListLayersResponseBody = {
  layers?: [ 
    {
      description?: string(name='Description'),
      domainId?: string(name='DomainId'),
      domainName?: string(name='DomainName'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifyTime?: string(name='GmtModifyTime'),
      isDefaultLayer?: boolean(name='IsDefaultLayer'),
      layerId?: string(name='LayerId'),
      name?: string(name='Name'),
      projectId?: string(name='ProjectId'),
      projectName?: string(name='ProjectName'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='Layers'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListLayersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLayersResponseBody(name='body'),
}

/**
 * @summary 获取实验层列表
 *
 * @param request ListLayersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLayersResponse
 */
async function listLayersWithOptions(request: ListLayersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListLayersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.domainId)) {
    query['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.layerId)) {
    query['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.layerName)) {
    query['LayerName'] = request.layerName;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLayers',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验层列表
 *
 * @param request ListLayersRequest
 * @return ListLayersResponse
 */
async function listLayers(request: ListLayersRequest): ListLayersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listLayersWithOptions(request, headers, runtime);
}

model ListMetricGroupsRequest {
  all?: boolean(name='All'),
  metricGroupId?: string(name='MetricGroupId'),
  metricGroupName?: string(name='MetricGroupName'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  sortBy?: string(name='SortBy'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListMetricGroupsResponseBody = {
  metricGroups?: [ 
    {
      description?: string(name='Description'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      metricGroupId?: string(name='MetricGroupId'),
      metrics?: [ 
        {
          definition?: string(name='Definition'),
          description?: string(name='Description'),
          gmtCreateTime?: string(name='GmtCreateTime'),
          gmtModifiedTime?: string(name='GmtModifiedTime'),
          metricId?: string(name='MetricId'),
          name?: string(name='Name'),
          relatedExperimentsNumber?: long(name='RelatedExperimentsNumber'),
          sourceTableMetaId?: string(name='SourceTableMetaId'),
        }
      ](name='Metrics'),
      name?: string(name='Name'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='MetricGroups'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListMetricGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMetricGroupsResponseBody(name='body'),
}

/**
 * @summary 获取指标组列表
 *
 * @param request ListMetricGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMetricGroupsResponse
 */
async function listMetricGroupsWithOptions(request: ListMetricGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMetricGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.metricGroupId)) {
    query['MetricGroupId'] = request.metricGroupId;
  }
  if (!Util.isUnset(request.metricGroupName)) {
    query['MetricGroupName'] = request.metricGroupName;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMetricGroups',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metricgroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指标组列表
 *
 * @param request ListMetricGroupsRequest
 * @return ListMetricGroupsResponse
 */
async function listMetricGroups(request: ListMetricGroupsRequest): ListMetricGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMetricGroupsWithOptions(request, headers, runtime);
}

model ListMetricsRequest {
  all?: string(name='All'),
  metricGroupId?: string(name='MetricGroupId'),
  metricId?: string(name='MetricId'),
  metricName?: string(name='MetricName'),
  order?: string(name='Order'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  sortBy?: string(name='SortBy'),
}

model ListMetricsResponseBody = {
  metrics?: [ 
    {
      definition?: string(name='Definition'),
      description?: string(name='Description'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      metricGroupId?: string(name='MetricGroupId'),
      metricId?: string(name='MetricId'),
      name?: string(name='Name'),
      sourceTableMetaId?: string(name='SourceTableMetaId'),
      sourceTableMetaName?: string(name='SourceTableMetaName'),
    }
  ](name='Metrics'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMetricsResponseBody(name='body'),
}

/**
 * @summary 获取指标列表
 *
 * @param request ListMetricsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMetricsResponse
 */
async function listMetricsWithOptions(request: ListMetricsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMetricsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.metricGroupId)) {
    query['MetricGroupId'] = request.metricGroupId;
  }
  if (!Util.isUnset(request.metricId)) {
    query['MetricId'] = request.metricId;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListMetrics',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metrics`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指标列表
 *
 * @param request ListMetricsRequest
 * @return ListMetricsResponse
 */
async function listMetrics(request: ListMetricsRequest): ListMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMetricsWithOptions(request, headers, runtime);
}

model ListProjectsRequest {
  all?: boolean(name='All'),
  name?: string(name='Name'),
  order?: string(name='Order'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  projectId?: string(name='ProjectId'),
  sortBy?: string(name='SortBy'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListProjectsResponseBody = {
  projects?: [ 
    {
      aliyunId?: string(name='AliyunId'),
      defaultDomainId?: string(name='DefaultDomainId'),
      defaultLayerId?: string(name='DefaultLayerId'),
      description?: string(name='Description'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      name?: string(name='Name'),
      projectId?: string(name='ProjectId'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='Projects'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectsResponseBody(name='body'),
}

/**
 * @summary 获取实验项目列表
 *
 * @param request ListProjectsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectsResponse
 */
async function listProjectsWithOptions(request: ListProjectsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjects',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验项目列表
 *
 * @param request ListProjectsRequest
 * @return ListProjectsResponse
 */
async function listProjects(request: ListProjectsRequest): ListProjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectsWithOptions(request, headers, runtime);
}

model ListTableMetasRequest {
  all?: boolean(name='All'),
  datasourceType?: string(name='DatasourceType'),
  order?: string(name='Order'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  sortBy?: string(name='SortBy'),
  tableMetaId?: string(name='TableMetaId'),
  tableMetaName?: string(name='TableMetaName'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListTableMetasResponseBody = {
  requestId?: string(name='RequestId'),
  tableMetas?: [ 
    {
      canDelete?: boolean(name='CanDelete'),
      datasourceInfo?: string(name='DatasourceInfo'),
      datasourceType?: string(name='DatasourceType'),
      description?: string(name='Description'),
      fields?: [ 
        {
          meaning?: string(name='Meaning'),
          name?: string(name='Name'),
          type?: string(name='Type'),
        }
      ](name='Fields'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      name?: string(name='Name'),
      tableMetaId?: string(name='TableMetaId'),
      tableName?: string(name='TableName'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='TableMetas'),
  totalCount?: long(name='TotalCount'),
}

model ListTableMetasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTableMetasResponseBody(name='body'),
}

/**
 * @summary 获取数据表列表
 *
 * @param request ListTableMetasRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTableMetasResponse
 */
async function listTableMetasWithOptions(request: ListTableMetasRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTableMetasResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.datasourceType)) {
    query['DatasourceType'] = request.datasourceType;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.tableMetaId)) {
    query['TableMetaId'] = request.tableMetaId;
  }
  if (!Util.isUnset(request.tableMetaName)) {
    query['TableMetaName'] = request.tableMetaName;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTableMetas',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取数据表列表
 *
 * @param request ListTableMetasRequest
 * @return ListTableMetasResponse
 */
async function listTableMetas(request: ListTableMetasRequest): ListTableMetasResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTableMetasWithOptions(request, headers, runtime);
}

model PushAllExperimentVersionRequest {
  featureName?: string(name='FeatureName', description='This parameter is required.'),
}

model PushAllExperimentVersionResponseBody = {
  featureId?: string(name='FeatureId'),
  requestId?: string(name='RequestId'),
}

model PushAllExperimentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushAllExperimentVersionResponseBody(name='body'),
}

/**
 * @summary 对实验版本推全
 *
 * @param request PushAllExperimentVersionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushAllExperimentVersionResponse
 */
async function pushAllExperimentVersionWithOptions(ExperimentVersionId: string, request: PushAllExperimentVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PushAllExperimentVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.featureName)) {
    body['FeatureName'] = request.featureName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PushAllExperimentVersion',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentversions/${OpenApiUtil.getEncodeParam(ExperimentVersionId)}/action/pushall`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 对实验版本推全
 *
 * @param request PushAllExperimentVersionRequest
 * @return PushAllExperimentVersionResponse
 */
async function pushAllExperimentVersion(ExperimentVersionId: string, request: PushAllExperimentVersionRequest): PushAllExperimentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return pushAllExperimentVersionWithOptions(ExperimentVersionId, request, headers, runtime);
}

model StartExperimentResponseBody = {
  requestId?: string(name='RequestId'),
}

model StartExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartExperimentResponseBody(name='body'),
}

/**
 * @summary 启动实验
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartExperimentResponse
 */
async function startExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StartExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StartExperiment',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/action/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启动实验
 *
 * @return StartExperimentResponse
 */
async function startExperiment(ExperimentId: string): StartExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return startExperimentWithOptions(ExperimentId, headers, runtime);
}

model StopExperimentResponseBody = {
  requestId?: string(name='RequestId'),
}

model StopExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopExperimentResponseBody(name='body'),
}

/**
 * @summary 停止实验
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopExperimentResponse
 */
async function stopExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopExperiment',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/action/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 停止实验
 *
 * @return StopExperimentResponse
 */
async function stopExperiment(ExperimentId: string): StopExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopExperimentWithOptions(ExperimentId, headers, runtime);
}

model UpdateCrowdRequest {
  description?: string(name='Description'),
  label?: string(name='Label'),
  name?: string(name='Name'),
  users?: string(name='Users'),
}

model UpdateCrowdResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCrowdResponseBody(name='body'),
}

/**
 * @summary 更新指定人群。
 *
 * @param request UpdateCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCrowdResponse
 */
async function updateCrowdWithOptions(CrowdId: string, request: UpdateCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateCrowdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.label)) {
    body['Label'] = request.label;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCrowd',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定人群。
 *
 * @param request UpdateCrowdRequest
 * @return UpdateCrowdResponse
 */
async function updateCrowd(CrowdId: string, request: UpdateCrowdRequest): UpdateCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateCrowdWithOptions(CrowdId, request, headers, runtime);
}

model UpdateDomainRequest {
  bucketType?: string(name='BucketType', description='This parameter is required.'),
  condition?: string(name='Condition'),
  crowIds?: string(name='CrowIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  flow?: long(name='Flow'),
  name?: string(name='Name', description='This parameter is required.'),
  projectId?: string(name='ProjectId', description='This parameter is required.'),
}

model UpdateDomainResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDomainResponseBody(name='body'),
}

/**
 * @summary 更新指定实验域
 *
 * @param request UpdateDomainRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDomainResponse
 */
async function updateDomainWithOptions(DomainId: string, request: UpdateDomainRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateDomainResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketType)) {
    body['BucketType'] = request.bucketType;
  }
  if (!Util.isUnset(request.condition)) {
    body['Condition'] = request.condition;
  }
  if (!Util.isUnset(request.crowIds)) {
    body['CrowIds'] = request.crowIds;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.flow)) {
    body['Flow'] = request.flow;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDomain',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/domains/${OpenApiUtil.getEncodeParam(DomainId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定实验域
 *
 * @param request UpdateDomainRequest
 * @return UpdateDomainResponse
 */
async function updateDomain(DomainId: string, request: UpdateDomainRequest): UpdateDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateDomainWithOptions(DomainId, request, headers, runtime);
}

model UpdateExperimentRequest {
  bucketType?: string(name='BucketType', description='This parameter is required.'),
  condition?: string(name='Condition'),
  coreMetricId?: string(name='CoreMetricId', description='This parameter is required.'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  endTime?: string(name='EndTime', description='This parameter is required.'),
  flow?: int32(name='Flow'),
  focusMetricIds?: string(name='FocusMetricIds', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  startTime?: string(name='StartTime', description='This parameter is required.'),
}

model UpdateExperimentResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentResponseBody(name='body'),
}

/**
 * @summary 更新指定的实验
 *
 * @param request UpdateExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentResponse
 */
async function updateExperimentWithOptions(ExperimentId: string, request: UpdateExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketType)) {
    body['BucketType'] = request.bucketType;
  }
  if (!Util.isUnset(request.condition)) {
    body['Condition'] = request.condition;
  }
  if (!Util.isUnset(request.coreMetricId)) {
    body['CoreMetricId'] = request.coreMetricId;
  }
  if (!Util.isUnset(request.crowdIds)) {
    body['CrowdIds'] = request.crowdIds;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.flow)) {
    body['Flow'] = request.flow;
  }
  if (!Util.isUnset(request.focusMetricIds)) {
    body['FocusMetricIds'] = request.focusMetricIds;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperiment',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定的实验
 *
 * @param request UpdateExperimentRequest
 * @return UpdateExperimentResponse
 */
async function updateExperiment(ExperimentId: string, request: UpdateExperimentRequest): UpdateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model UpdateExperimentVersionRequest {
  config?: string(name='Config'),
  crowdIds?: string(name='CrowdIds'),
  debugUsers?: string(name='DebugUsers'),
  description?: string(name='Description'),
  flow?: int32(name='Flow'),
  name?: string(name='Name', description='This parameter is required.'),
  type?: string(name='Type', description='This parameter is required.'),
}

model UpdateExperimentVersionResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateExperimentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentVersionResponseBody(name='body'),
}

/**
 * @summary 更新指定的实验版本
 *
 * @param request UpdateExperimentVersionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentVersionResponse
 */
async function updateExperimentVersionWithOptions(ExperimentVersionId: string, request: UpdateExperimentVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.crowdIds)) {
    body['CrowdIds'] = request.crowdIds;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.flow)) {
    body['Flow'] = request.flow;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperimentVersion',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentversions/${OpenApiUtil.getEncodeParam(ExperimentVersionId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定的实验版本
 *
 * @param request UpdateExperimentVersionRequest
 * @return UpdateExperimentVersionResponse
 */
async function updateExperimentVersion(ExperimentVersionId: string, request: UpdateExperimentVersionRequest): UpdateExperimentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentVersionWithOptions(ExperimentVersionId, request, headers, runtime);
}

model UpdateFeatureRequest {
  status?: string(name='Status', description='This parameter is required.'),
}

model UpdateFeatureResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFeatureResponseBody(name='body'),
}

/**
 * @summary 更新Feature
 *
 * @param request UpdateFeatureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFeatureResponse
 */
async function updateFeatureWithOptions(FeatureId: string, request: UpdateFeatureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFeatureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFeature',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/features/${OpenApiUtil.getEncodeParam(FeatureId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新Feature
 *
 * @param request UpdateFeatureRequest
 * @return UpdateFeatureResponse
 */
async function updateFeature(FeatureId: string, request: UpdateFeatureRequest): UpdateFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFeatureWithOptions(FeatureId, request, headers, runtime);
}

model UpdateLayerRequest {
  description?: string(name='Description'),
  domainId?: string(name='DomainId'),
  name?: string(name='Name', description='This parameter is required.'),
  projectId?: string(name='ProjectId', description='This parameter is required.'),
}

model UpdateLayerResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLayerResponseBody(name='body'),
}

/**
 * @summary 更新指定的实验层
 *
 * @param request UpdateLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLayerResponse
 */
async function updateLayerWithOptions(LayerId: string, request: UpdateLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateLayerResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.domainId)) {
    body['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLayer',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定的实验层
 *
 * @param request UpdateLayerRequest
 * @return UpdateLayerResponse
 */
async function updateLayer(LayerId: string, request: UpdateLayerRequest): UpdateLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateLayerWithOptions(LayerId, request, headers, runtime);
}

model UpdateMetricRequest {
  definition?: string(name='Definition', description='This parameter is required.'),
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  sourceTableMetaId?: string(name='SourceTableMetaId'),
}

model UpdateMetricResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMetricResponseBody(name='body'),
}

/**
 * @summary 更新指标
 *
 * @param request UpdateMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMetricResponse
 */
async function updateMetricWithOptions(MetricId: string, request: UpdateMetricRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateMetricResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.definition)) {
    body['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.sourceTableMetaId)) {
    body['SourceTableMetaId'] = request.sourceTableMetaId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMetric',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metrics/${OpenApiUtil.getEncodeParam(MetricId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指标
 *
 * @param request UpdateMetricRequest
 * @return UpdateMetricResponse
 */
async function updateMetric(MetricId: string, request: UpdateMetricRequest): UpdateMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateMetricWithOptions(MetricId, request, headers, runtime);
}

model UpdateMetricGroupRequest {
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.'),
}

model UpdateMetricGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMetricGroupResponseBody(name='body'),
}

/**
 * @summary 更新指定的指标组
 *
 * @param request UpdateMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMetricGroupResponse
 */
async function updateMetricGroupWithOptions(MetricGroupId: string, request: UpdateMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateMetricGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMetricGroup',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/metricgroups/${OpenApiUtil.getEncodeParam(MetricGroupId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定的指标组
 *
 * @param request UpdateMetricGroupRequest
 * @return UpdateMetricGroupResponse
 */
async function updateMetricGroup(MetricGroupId: string, request: UpdateMetricGroupRequest): UpdateMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateMetricGroupWithOptions(MetricGroupId, request, headers, runtime);
}

model UpdateProjectRequest {
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
}

model UpdateProjectResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectResponseBody(name='body'),
}

/**
 * @summary 更新指定的实验项目
 *
 * @param request UpdateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectResponse
 */
async function updateProjectWithOptions(ProjectId: string, request: UpdateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProject',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${OpenApiUtil.getEncodeParam(ProjectId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新指定的实验项目
 *
 * @param request UpdateProjectRequest
 * @return UpdateProjectResponse
 */
async function updateProject(ProjectId: string, request: UpdateProjectRequest): UpdateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectWithOptions(ProjectId, request, headers, runtime);
}

model UpdateTableMetaRequest {
  description?: string(name='Description'),
  fields?: [ 
    {
      meaning?: string(name='Meaning', description='This parameter is required.'),
      name?: string(name='Name', description='This parameter is required.'),
      type?: string(name='Type', description='This parameter is required.'),
    }
  ](name='Fields', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
}

model UpdateTableMetaResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTableMetaResponseBody(name='body'),
}

/**
 * @summary 更新数据表
 *
 * @param request UpdateTableMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTableMetaResponse
 */
async function updateTableMetaWithOptions(TableMetaId: string, request: UpdateTableMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTableMetaResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTableMeta',
    version = '2024-01-19',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas/${OpenApiUtil.getEncodeParam(TableMetaId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新数据表
 *
 * @param request UpdateTableMetaRequest
 * @return UpdateTableMetaResponse
 */
async function updateTableMeta(TableMetaId: string, request: UpdateTableMetaRequest): UpdateTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTableMetaWithOptions(TableMetaId, request, headers, runtime);
}

